<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::Ensemble&lt; ModelType, OutputType &gt; Class Template Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_ensemble.html">Ensemble</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_ensemble-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::Ensemble&lt; ModelType, OutputType &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__models.html">Models</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Represents en weighted ensemble of models.  
 <a href="classshark_1_1_ensemble.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_ensemble_8h_source.html">shark/Models/Ensemble.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for shark::Ensemble&lt; ModelType, OutputType &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classshark_1_1_ensemble__inherit__graph.png" border="0" usemap="#ashark_1_1_ensemble_3_01_model_type_00_01_output_type_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="ashark_1_1_ensemble_3_01_model_type_00_01_output_type_01_4_inherit__map" id="ashark_1_1_ensemble_3_01_model_type_00_01_output_type_01_4_inherit__map">
<area shape="rect" title="Represents en weighted ensemble of models." alt="" coords="5,94,204,135"/>
<area shape="rect" title=" " alt="" coords="10,5,199,46"/>
<area shape="poly" title=" " alt="" coords="107,62,107,94,102,94,102,62"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3508e39c8cbf40de08dcd387670a8f58" id="r_a3508e39c8cbf40de08dcd387670a8f58"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#a3508e39c8cbf40de08dcd387670a8f58">name</a> () const</td></tr>
<tr class="memdesc:a3508e39c8cbf40de08dcd387670a8f58"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the name of the object  <br /></td></tr>
<tr class="separator:a3508e39c8cbf40de08dcd387670a8f58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa96d4139d33b84477f8a41d9d12c8bb" id="r_aaa96d4139d33b84477f8a41d9d12c8bb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#aaa96d4139d33b84477f8a41d9d12c8bb">addModel</a> (ModelType const &amp;<a class="el" href="classshark_1_1_ensemble.html#ade2b84f506a9ca05c99b048d89a81e49">model</a>, double <a class="el" href="classshark_1_1_ensemble.html#a8362fb3624b7976c8260cb5c1e98f311">weight</a>=1.0)</td></tr>
<tr class="memdesc:aaa96d4139d33b84477f8a41d9d12c8bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a new model to the ensemble.  <br /></td></tr>
<tr class="separator:aaa96d4139d33b84477f8a41d9d12c8bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab04ccf3f9acb405f3fdedd125ff5ed1c" id="r_ab04ccf3f9acb405f3fdedd125ff5ed1c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#ab04ccf3f9acb405f3fdedd125ff5ed1c">clearModels</a> ()</td></tr>
<tr class="memdesc:ab04ccf3f9acb405f3fdedd125ff5ed1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all models from the ensemble.  <br /></td></tr>
<tr class="separator:ab04ccf3f9acb405f3fdedd125ff5ed1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e09f390e1605b270f0ec17b7845e472" id="r_a1e09f390e1605b270f0ec17b7845e472"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#a1e09f390e1605b270f0ec17b7845e472">numberOfModels</a> () const</td></tr>
<tr class="memdesc:a1e09f390e1605b270f0ec17b7845e472"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of models.  <br /></td></tr>
<tr class="separator:a1e09f390e1605b270f0ec17b7845e472"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade2b84f506a9ca05c99b048d89a81e49" id="r_ade2b84f506a9ca05c99b048d89a81e49"><td class="memItemLeft" align="right" valign="top">std::remove_pointer&lt; ModelType &gt;::type &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#ade2b84f506a9ca05c99b048d89a81e49">model</a> (std::size_t i)</td></tr>
<tr class="memdesc:ade2b84f506a9ca05c99b048d89a81e49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a reference to the i-th model.  <br /></td></tr>
<tr class="separator:ade2b84f506a9ca05c99b048d89a81e49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ca0daef198afeb7c77203e30c80d52e" id="r_a9ca0daef198afeb7c77203e30c80d52e"><td class="memItemLeft" align="right" valign="top">std::remove_pointer&lt; ModelType &gt;::type const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#a9ca0daef198afeb7c77203e30c80d52e">model</a> (std::size_t i) const</td></tr>
<tr class="memdesc:a9ca0daef198afeb7c77203e30c80d52e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a const reference to the i-th model.  <br /></td></tr>
<tr class="separator:a9ca0daef198afeb7c77203e30c80d52e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8362fb3624b7976c8260cb5c1e98f311" id="r_a8362fb3624b7976c8260cb5c1e98f311"><td class="memItemLeft" align="right" valign="top">double const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#a8362fb3624b7976c8260cb5c1e98f311">weight</a> (std::size_t i) const</td></tr>
<tr class="memdesc:a8362fb3624b7976c8260cb5c1e98f311"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the weight of the i-th model.  <br /></td></tr>
<tr class="separator:a8362fb3624b7976c8260cb5c1e98f311"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b8b29b5b1749b42ed5cd79a6aab7952" id="r_a2b8b29b5b1749b42ed5cd79a6aab7952"><td class="memItemLeft" align="right" valign="top">double &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#a2b8b29b5b1749b42ed5cd79a6aab7952">weight</a> (std::size_t i)</td></tr>
<tr class="memdesc:a2b8b29b5b1749b42ed5cd79a6aab7952"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the weight of the i-th model.  <br /></td></tr>
<tr class="separator:a2b8b29b5b1749b42ed5cd79a6aab7952"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6965c4363321584b44389670044d24bd" id="r_a6965c4363321584b44389670044d24bd"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_ensemble.html#a6965c4363321584b44389670044d24bd">sumOfWeights</a> () const</td></tr>
<tr class="memdesc:a6965c4363321584b44389670044d24bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the total sum of weights used for averaging.  <br /></td></tr>
<tr class="separator:a6965c4363321584b44389670044d24bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;class ModelType, class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> = void&gt;<br />
class shark::Ensemble&lt; ModelType, OutputType &gt;</div><p>Represents en weighted ensemble of models. </p>
<p>In an ensemble, each model computes a response for an input independently. The responses are then pooled to form a single label. The hope is that models in an ensemble do not produce the same type of errors and thus the averaged response is more reliable. An example for this is AdaBoost, where a series of weak models is trained and weighted to create one final prediction.</p>
<p>There are two orthogonal aspects to consider in the <a class="el" href="classshark_1_1_ensemble.html" title="Represents en weighted ensemble of models.">Ensemble</a>. The pooling function, which is chosen based on the output type of the ensemble models, and the mapping of the output of the pooling function to the model output.</p>
<p>If the ensemble consists of models returning vectors, pooling is implemented using weighted averaging. If the models return class labels, those are first transformed into a one-hot encoding before averaging. Thus the output can be interpreted as the probability of a class label when picking a member of the emsemble randomly with probability proportional to its weights.</p>
<p>The final mapping to the output is based on the OutputType template parameter, which by default is the same as the output type of the model. If it is unsigned int, the <a class="el" href="classshark_1_1_ensemble.html" title="Represents en weighted ensemble of models.">Ensemble</a> is treated as <a class="el" href="classshark_1_1_classifier.html" title="Conversion of real-valued or vector valued outputs to class labels.">Classifier</a> with decision function being the result of the pooling function (i.e. the class with maximum response in the weighted average is chosen). In this case, Essemble is derived from Classifier&lt;&gt;. Otherwise the weighted average is returned.</p>
<p>Note that there is a decision in algorihm design tot ake for classifiers: We can either let each member of the <a class="el" href="classshark_1_1_ensemble.html" title="Represents en weighted ensemble of models.">Ensemble</a> predict a class-label and then pool the labels as described above, or we can create an ensemble of decision functions and weight them into one decision function to produce the class-label. Those approaches will lead to different results. For example if the underlying models produce class probabilities, the class with the largest average probability might not be the same as the class with most votes from the individual models.</p>
<p>Models are added using addModel. The ModelType is allowed to be either a concrete model like LinearModel&lt;&gt;, in which case a copy of each added model is stored. If the ModelType is a pointer, for example AbstractModel&lt;...&gt;*, only pointers are stored and all added models must outlive the lifetime of the ensemble. This also entails differences in serialization. In the first case, the model can be serialized completely without any setup. In the second case before deserializing, the models must be constructed and added. </p>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00252">252</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aaa96d4139d33b84477f8a41d9d12c8bb" name="aaa96d4139d33b84477f8a41d9d12c8bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa96d4139d33b84477f8a41d9d12c8bb">&#9670;&#160;</a></span>addModel()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::addModel </td>
          <td>(</td>
          <td class="paramtype">ModelType const &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>weight</em> = <code>1.0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adds a new model to the ensemble. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>the new model </td></tr>
    <tr><td class="paramname">weight</td><td>weight of the model. must be &gt; 0 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00261">261</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_ensemble.html#ade2b84f506a9ca05c99b048d89a81e49">shark::Ensemble&lt; ModelType, OutputType &gt;::model()</a>, and <a class="el" href="classshark_1_1_ensemble.html#a8362fb3624b7976c8260cb5c1e98f311">shark::Ensemble&lt; ModelType, OutputType &gt;::weight()</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_r_f_trainer_3_01unsigned_01int_01_4.html#a4c1081a998508d12064ec653130f1a8f">shark::RFTrainer&lt; unsigned int &gt;::train()</a>, and <a class="el" href="classshark_1_1_r_f_trainer_3_01_real_vector_01_4.html#a4975033b328b481f5bbfa2fea88ddcd9">shark::RFTrainer&lt; RealVector &gt;::train()</a>.</p>

</div>
</div>
<a id="ab04ccf3f9acb405f3fdedd125ff5ed1c" name="ab04ccf3f9acb405f3fdedd125ff5ed1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab04ccf3f9acb405f3fdedd125ff5ed1c">&#9670;&#160;</a></span>clearModels()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::clearModels </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Removes all models from the ensemble. </p>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00266">266</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_r_f_trainer_3_01unsigned_01int_01_4.html#a4c1081a998508d12064ec653130f1a8f">shark::RFTrainer&lt; unsigned int &gt;::train()</a>, and <a class="el" href="classshark_1_1_r_f_trainer_3_01_real_vector_01_4.html#a4975033b328b481f5bbfa2fea88ddcd9">shark::RFTrainer&lt; RealVector &gt;::train()</a>.</p>

</div>
</div>
<a id="ade2b84f506a9ca05c99b048d89a81e49" name="ade2b84f506a9ca05c99b048d89a81e49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade2b84f506a9ca05c99b048d89a81e49">&#9670;&#160;</a></span>model() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::remove_pointer&lt; ModelType &gt;::type &amp; <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::model </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a reference to the i-th model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>model index. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00278">278</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_ensemble.html#aaa96d4139d33b84477f8a41d9d12c8bb">shark::Ensemble&lt; ModelType, OutputType &gt;::addModel()</a>.</p>

</div>
</div>
<a id="a9ca0daef198afeb7c77203e30c80d52e" name="a9ca0daef198afeb7c77203e30c80d52e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ca0daef198afeb7c77203e30c80d52e">&#9670;&#160;</a></span>model() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::remove_pointer&lt; ModelType &gt;::type const  &amp; <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::model </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a const reference to the i-th model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>model index. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00284">284</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

</div>
</div>
<a id="a3508e39c8cbf40de08dcd387670a8f58" name="a3508e39c8cbf40de08dcd387670a8f58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3508e39c8cbf40de08dcd387670a8f58">&#9670;&#160;</a></span>name()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::name </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>returns the name of the object </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_i_nameable.html#a9893f99314de30cd472e649c235d0db4">shark::INameable</a>.</p>

<p>Reimplemented in <a class="el" href="classshark_1_1_r_f_classifier.html#a5104a2e299a21cd91d909fe755db1ea1">shark::RFClassifier&lt; LabelType &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00254">254</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

</div>
</div>
<a id="a1e09f390e1605b270f0ec17b7845e472" name="a1e09f390e1605b270f0ec17b7845e472"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e09f390e1605b270f0ec17b7845e472">&#9670;&#160;</a></span>numberOfModels()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::numberOfModels </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the number of models. </p>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00271">271</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

</div>
</div>
<a id="a6965c4363321584b44389670044d24bd" name="a6965c4363321584b44389670044d24bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6965c4363321584b44389670044d24bd">&#9670;&#160;</a></span>sumOfWeights()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::sumOfWeights </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the total sum of weights used for averaging. </p>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00303">303</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

</div>
</div>
<a id="a2b8b29b5b1749b42ed5cd79a6aab7952" name="a2b8b29b5b1749b42ed5cd79a6aab7952"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b8b29b5b1749b42ed5cd79a6aab7952">&#9670;&#160;</a></span>weight() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double &amp; <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::weight </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the weight of the i-th model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>model index. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00298">298</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

</div>
</div>
<a id="a8362fb3624b7976c8260cb5c1e98f311" name="a8362fb3624b7976c8260cb5c1e98f311"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8362fb3624b7976c8260cb5c1e98f311">&#9670;&#160;</a></span>weight() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ModelType , class <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a>  = void&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double const  &amp; <a class="el" href="classshark_1_1_ensemble.html">shark::Ensemble</a>&lt; ModelType, <a class="el" href="classshark_1_1_abstract_model.html#a8e5acf043e3a76b50d15a852365801b4">OutputType</a> &gt;::weight </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the weight of the i-th model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>model index. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_ensemble_8h_source.html#l00291">291</a> of file <a class="el" href="_ensemble_8h_source.html">Ensemble.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_ensemble.html#aaa96d4139d33b84477f8a41d9d12c8bb">shark::Ensemble&lt; ModelType, OutputType &gt;::addModel()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/Models/<a class="el" href="_ensemble_8h_source.html">Ensemble.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
